package com.cn.api;




import com.cn.dto.VisitorDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Primary
@FeignClient(value = "order-client", path = "/api/visitor")
public interface VisitorCoreService {


    @GetMapping("/findAll")
    List<VisitorDTO> findAll(@RequestBody VisitorDTO visitorDTO);

    @GetMapping("/findByVisitorId")
    List<VisitorDTO> findByVisitorId(@RequestParam("visitorId") Integer userId);

    @GetMapping("/findByOrderNumber")
    List<VisitorDTO> findByOrderNumber(@RequestParam("visitorId") String orderNumber);

    @PostMapping("/add")
    Integer add(@RequestBody VisitorDTO visitorDTO);

    @PostMapping("/update")
    Integer update(@RequestBody VisitorDTO visitorDTO);

    @PostMapping("/delete")
    Integer delete(@RequestBody Integer integer);

}
